<%-- 
    Document   : index
    Created on : 2013-5-31, 10:06:28
    Author     : sam.zheng <zcl1866@sina.com> 
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<c:import url="/resource/include/header.jsp" charEncoding="UTF-8" />
<title>仿拉手网首页【SIXBOY】</title>
<style>
.mya {
	display: block;
	width: 97px;
	margin-top: 6px;
	padding-left: 5px;
	height: 23px;
	font: 12px/25px \5b8b\4f53;
	text-align: center;
	background-position: 0 -282px;
	color: #FFF;
	text-shadow: 1px 1px 1px #7186b1;
	overflow: hidden;
}

.myimg {
	width:50px;
	height:50px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){      
	$('#btn1').click(function() {  
	   //本次新增的图片
	   //本次删除的图片
		     
	   $('#form1').submit();           
	});
	$('#btn2').click(function() {  
		     
	   history.back();           
	});
	$('#reUplaodA').click(function() {  
		     
		
		$('#table1').css('display','none');
		$('#table2').css('display','');
		
		$('#deletedLogos').val("true");
	});
	
	

});  
</script>
</head>
<body>
	<div id="header">
		<c:import url="/app/tpl/header" charEncoding="UTF-8" />
	</div>
	<div id="main">
		<div class="sort">
			<div class="sortt">
				<div class="popular">
					<span><a href="../shanghu/list" >商户管理</a></span>
				</div>
			</div>
			<div class="sortcon">
				<div class="sortcon-link">
					<span class="title">查&nbsp;&nbsp;询：</span> <span class="title">
						请输入关键字</span> <input class="mytext" type="text" name="model.name" /> <input
						class="mybtn" type="button" />
					<div class="clr"></div>
				</div>

			</div>

			<div class="sequence">
				<span class="title">排&nbsp;&nbsp;序：</span> <a class="current"
					title="默认排序"
					onclick="_gaq.push(['_trackEvent','Sort','default_new']);resetIndex('default');"
					href="javascript:void(0)">默认</a> <a title="按发布时间排序"
					onclick="_gaq.push(['_trackEvent','Sort','time_new']);resetIndex('time');"
					href="javascript:void(0)"><span>最新</span><span class="down"></span>
				</a> <a title="销量从高到低"
					onclick="_gaq.push(['_trackEvent','Sort','rate_new']);resetIndex('rate');"
					href="javascript:void(0)"><span>销量</span><span class="down"></span>
				</a> 
				<div class="page-mini">
					<a href="/page1" class="right right-dis">新增</a> 
				</div>
			</div>
		</div>
		<div class="content-list">
			<form id="form1" action="update" method="post" enctype="multipart/form-data">
				<input type="hidden" name="deletedLogos" id="deletedLogos" value="false" >
				<input type="hidden" name="id" id="id" value="${obj.id }" >
				<table border="1px" width="100%">
					<tr>
						<td>商家（餐厅饭店）名称</td>
						<td><input type="text" name="name" value="${obj.name }" /></td>
					</tr>
					<tr>
						<td>商家（餐厅饭店）简介</td>
						<td><input type="text" name="descprition" value="${obj.descprition }" /></td>
					</tr>
					<tr>
						<td>商家图片展示（限5张）<a id="reUplaodA" href="#" >重新上传</a> </td>
						<td id="mytd">
							<table id="table1">
								<!-- 定义临时变量，获取当前商户已上传了几张logo图片 -->
								<c:set var="tmpLen" value="0"></c:set>
								<c:forEach items="${fn:split(obj.logos,',') }"   var="o">
									<c:if test="${fn:length(o) >0 }">
										<c:set var="tmpLen" value="${tmpLen +1 }" />
										<tr>
											<td>&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${tmpLen }"></c:out> </td>
											<td>&nbsp;&nbsp;&nbsp;&nbsp;<img id="img${tmpLen }" class="myimg" src="http://localhost:8080/sixboy/upload/shanghu/${o }" /></td>
										</tr>
									</c:if> 
								</c:forEach>
							</table>
							<table id="table2" style="display:none">
								<tr><td><input type="file" name="logoFiles"/></td></tr>
								<tr><td><input type="file" name="logoFiles"/></td></tr>
								<tr><td><input type="file" name="logoFiles"/></td></tr>
								<tr><td><input type="file" name="logoFiles"/></td></tr>
								<tr><td><input type="file" name="logoFiles"/></td></tr>
							</table>
						</td>
					</tr>
						<td>营业时间</td>
						<td><input type="text" name="businessTime" value="${obj.businessTime }" /></td>
					</tr>
						<td>地址</td>
						<td><input type="text" name="address" value="${obj.address }" /></td>
					</tr>
						<td colspan="2" ><input id="btn1" type="button" value="保存" />&nbsp;&nbsp;&nbsp;&nbsp;<input id="btn2" type="button" value="取消" /></td>
					</tr>
					</tr>
				</table>
			</form>
			<div class="clr"></div>
		</div>
		<div id="footer">
			<c:import url="/app/tpl/footer" charEncoding="UTF-8" />
		</div>
		<div id="go-top"
			style="margin-right: -535px; right: 50%; display: block;">
			<a title="返回顶部" href="javascript:void(0)">返回顶部</a>
		</div>
</body>